// 路由管理
import routes from './routes';
import { createRouter, createWebHashHistory } from 'vue-router';
// 创建路由实例
const router = createRouter({
	history: createWebHashHistory(),
	routes
});
// 在这里添加路由的导航守卫
router.beforeEach((to, from, next) => {
    console.log('Navigating to:', to.path);
    console.log('Navigating from:', from.path);
    next();
  });
/* 初始化路由表 */
export function resetRouter() {
	router.getRoutes().forEach((route) => {
		const { name } = route;
		if (name) {
			router.hasRoute(name) && router.removeRoute(name);
		}
	});
}
export default router


